{% extends "layout.html" %}
{% from "snippet/macro.html" import topic_columns, pagination, navigation %}

{% block subtitle %}{{ _('Topics') }}{% endblock %}

{% block nav %}{{ navigation('topic') }}{% endblock %}

{% block content %}
  <div class="panel panel-default">
    <div class="panel-heading clearfix">
      <ul class="pull-right nav nav-pills">
        {% if endpoint == 'topic.topics' %}
          <li class="active">{% else %}
          <li>{% endif %}
        <a href="{{ url_for('topic.topics') }}">{{ _('Update') }}</a>
        </li>
        {% if endpoint == 'topic.latest' %}
          <li class="active">{% else %}
          <li>{% endif %}
        <a href="{{ url_for('topic.latest') }}">{{ _('Latest') }}</a>
        </li>
        {% if endpoint == 'topic.desert' %}
          <li class="active">{% else %}
          <li>{% endif %}
        <a href="{{ url_for('topic.desert') }}">{{ _('Desert') }}</a>
        </li>
      </ul>
    </div>
    <div class="panel-columns">
      {{ topic_columns(paginator.items) }}
    </div>
    {% if paginator.pages > 1 %}
      <div class="panel-footer">
        {{ pagination(paginator, url_for(endpoint)) }}
      </div>
    {% endif %}
  </div>
{% endblock %}
